x86/HVM: fix processing of RTC REG_B writes
authorJan Beulich <jbeulich@suse.com>
Thu, 2 May 2013 14:47:32 +0000 (16:47 +0200)
committerJan Beulich <jbeulich@suse.com>
Thu, 2 May 2013 14:47:32 +0000 (16:47 +0200)
commitc2f79c464849e5f796aa9d1d0f26fe356abd1a1a
treedd5a2f125bad5eb9adb690d762158f38de231bee
parentd1222afda4d27916580c28533762e362d64ace22
x86/HVM: fix processing of RTC REG_B writes

We must store the new values before calling rtc_update_irq(), and we
need to call rtc_timer_update() when PIE transitions from 0 to 1 (as we
may have previously turned off the periodic timer due to the guest not
reading REG_C, and hence may have to re-enable it in order to start
IRQs getting delivered to the guest).

Note that the timer is being kept running if PIE transitions from 1 to
0, to match the behavior of keeping it running for a brief period of
time if the guest doesn't clear PF in time (in order to avoid
permanently destroying and re-creating the periodic timer).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Tested-by: Roger Pau Monné <roger.pau@citrix.com> (FreeBSD guest)
Reviewed-by: Tim Deegan <tim@xen.org>
xen/arch/x86/hvm/rtc.c